The following code uses the ChickWeight database, which contains the weight data in gram of 48 individual chicks during their growth, as a function of time and diet. There are 4 different diets, and the timeframe goes from 0 to 21 days maximum.
library(plotly)
library(dplyr)
plot1 <- ggplot(ChickWeight, aes(x = Time, y = weight,
color = factor(Chick))) +
geom_line() +
geom_point(size = 0.5) +
facet_wrap(~Diet) +
labs(title = "Chicks growth as a function of their diet and time",
x = "Time [days]",
y = "Weight [g]") +
theme(legend.position = "none")